package com.zzg.springboot.controller;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.zzg.springboot.dao.UserDao;
import com.zzg.springboot.entity.UserEntity;
import com.zzg.springboot.entity.enumerate.SexEnum;


@Controller
@RequestMapping("/api/springboot")
public class UserController {
	@Autowired
	private UserDao dao;
	
	@RequestMapping(value="/init", method={RequestMethod.GET})
	public void init(){
		UserEntity user = new UserEntity("name-10","pwd-10","address-10");
		user.setSex(SexEnum.FMAIL);
		user.setBirthday(new Date());
		user.setMessage("此属性字段无法映射数据库表");
		dao.save(user);
	}

}
